﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaxAssistantBase;

namespace ShiBieProject
{
    class SetInvoiceProductNameAndDefaultTaxRate
    {
        public static void invoiceProductNameAndDefaultTaxRate(List<InvoiiceOcrModel> bpmlist)
        {
            foreach(InvoiiceOcrModel bpm in bpmlist)
            {
                List<BatchInfo> batchlist = new List<BatchInfo>();
                string companyName = bpm.companyName;
                string isProviderOrCustomer = bpm.invoiceOcrSonLists[0].isProviderOrCustomer;
                string taxmoneyes = bpm.invoiceOcrSonLists[0].taxAmounts;
                string moneyAmounts = bpm.invoiceOcrSonLists[0].moneyAmounts;
                string invoiceMark = bpm.invoiceOcrSonLists[0].invoiceMark;
                decimal taxmoneye;
                decimal moneyamount;
                decimal taxRate;
                //赋值城市
                if (companyName.Contains("福州")) {
                    bpm.cityName = "福州";
                }
                else if (companyName.Contains("上海"))
                {
                    bpm.cityName = "上海";
                }
                else if (companyName.Contains("杭州")|| companyName.Contains("浙江"))
                {
                    bpm.cityName = "杭州";
                }
                else if (companyName.Contains("长沙") || companyName.Contains("湖南"))
                {
                    bpm.cityName = "长沙";
                }
                else if (companyName.Contains("广州"))
                {
                    bpm.cityName = "广州";
                }
                var dataList = from complist in HongFengCompanyOrVendorsTool.companyAll where complist.companyName == companyName select complist;
                batchlist = dataList.ToList();
                if (batchlist.Count > 0)
                {
                    string defaultTaxRate = batchlist[0].defaultTaxRate;
                    string productName = batchlist[0].productName;
                }
                else {
                    break;
                }
            }
        }
    }
}
